home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 16
/
64er_Magazin_Sonderheft_16_19xx_Markt__Technik_de_Side_A.d64
/
ls 11.doc
< prev
next >
Wrap
Text File
|
2022-10-26
|
2KB
|
100 lines
Assemblerlisting zur Animation eines Sprites
,8000 a9 05 lda #05 ;Rahmenfarbe
,8002 8d 20 d0 sta d020
,8005 a9 00 lda #00 ;Hintergrundfarbe
,8007 8d 21 d0 sta d021
,800a a9 08 lda #08 ;Sprite-Farbe 1
,800c 8d 25 d0 sta d025
,800f a9 0b lda #0b ;Sprite-Farbe 2
,8011 8d 26 d0 sta d026
,8014 a9 07 lda #07 ;Sprite-Farbe 3
,8016 8d 27 d0 sta d027
,8019 a9 01 lda #01 ;Multicolor
,801b 8d 1c d0 sta d01c
,801e a9 80 lda #80 ;Spritezeiger Block 128
,8020 8d f8 07 sta 07f8
,8023 a9 a0 lda #a0 ;Y-Anfangsposition
,8025 8d 01 d0 sta d001
,8028 a9 00 lda #00 ;X-Anfangsposition
,802a 8d 00 d0 sta d000
,802d 8d 10 d0 sta d010 ;]berlaufregister l{$7c}schen
,8030 a9 01 lda #01 ;Sprite 0 an
,8032 8d 15 d0 sta d015
,8035 20 59 80 jsr 8059 ;Unterprogramm Animation
,8038 ee 00 d0 inc d000 ;X-Position + 2
,803b ee 00 d0 inc d000
,803e d0 f5 bne 8035
,8040 a9 01 lda #01 ;wenn X>255 ]berlaufbit setzen
,8042 8d 10 d0 sta d010
,8045 20 59 80 jsr 8059 ;Unterprogramm Animation
,8048 ee 00 d0 inc d000 ;X-Position + 2
,804b ee 00 d0 inc d000
,804e ad 00 d0 lda d000 ;Abfrage
,8051 c9 5a cmp #5a ;auf Ende (X>350)
,8053 30 f0 bmi 8045
,8055 18 clc
,8056 4c 00 80 jmp 8000 ;Neustart
-----------------------------------
,8059 ;Unterprogramm Animation
,8059 ae f8 07 ldx 07f8
,805c e8 inx ;n{$7b}chstes Bild
,805d e0 88 cpx #88
,805f d0 02 bne 8063
,8061 a2 80 ldx #80
,8063 8e f8 07 stx 07f8 ;in Spritezeiger
,8066 20 6a 80 jsr 806a ;Unterprogramm Warteschleife
,8069 60 rts ;Ende Animation
-----------------------------------
,806a ;Unterprogramm Warteschleife
,806a a2 00 ldx #00
,806c a0 10 ldy #10 ;Schleifendauer
,806e ca dex
,806f d0 fd bne 806e
,8071 ca dex
,8072 d0 fa bne 806e
,8074 60 rts ;Ende Warteschleife